﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _使用参数化执行SQL语句
{
    /// <summary>
    /// 连接字符串配置
    /// </summary>
    public static class WebConfig
    {
        /// <summary>
        /// 默认连接字符串
        /// </summary>
        public static string DefaultConfigString = System.Configuration.ConfigurationManager.ConnectionStrings["Default"].ToString();

        /// <summary>
        /// 获取指定连接字符串
        /// </summary>
        /// <param name="ConnectionStringKey">指定连接字符串配置的Key值</param>
        /// <returns>连接字符串</returns>
        public static string GetConfigString(string ConnectionStringKey)
        {
            return System.Configuration.ConfigurationManager.ConnectionStrings[ConnectionStringKey].ToString();
        }
    }
}
